//
// Created by 郝羽 on 2018/6/22.
//

#include "Http.hpp"

void post_complete_callback(SoupSession *session, SoupMessage *msg, gpointer user_data) {
    HttpCallback* cb = reinterpret_cast<HttpCallback*>(user_data);
    int status_code = static_cast<int>(msg->status_code);
    std::string body = std::string(msg->response_body->data, msg->response_body->length);
    (*cb)(status_code, body);
    delete cb;
}
